import os
basedir = os.path.abspath(os.path.dirname(__file__))
'''
class Config(object):
    SECRET_KEY = 'had to guess string'
    SQLALCHEMY_TRACK_MODIFICATIONS=False
class ProConfig(Config):
    pass
class DevConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = "sqlite:///database.db"
    ##SQLALCHEMY_ECHO = True
'''
class Config:
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'had to guess string'
    MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.sina.com.cn')
    MAIL_PORT = int(os.environ.get('MAIL_PORT', '25'))
    MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'true').lower() in ['true', 'on', '1']
    MAIL_USERNAME = os.environ.get('malj007')
    MAIL_PASSWORD = os.environ.get('deci8106199')
    FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]'
    FLASKY_MAIL_SENDER = 'Flasky Admin <flasky@example.com>'
    FLASKY_ADMIN = os.environ.get('FLASKY_ADMIN')
    #SSL_REDIRECT = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    #SQLALCHEMY_RECORD_QUERIES = True
    #FLASKY_POSTS_PER_PAGE = 20
    #FLASKY_FOLLOWERS_PER_PAGE = 50
    #FLASKY_COMMENTS_PER_PAGE = 30
    #FLASKY_SLOW_DB_QUERY_TIME = 0.5

    @staticmethod
    def init_app(app):
        pass

class DevConfig(Config):
    DEBUG = True
    SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
        'sqlite:///' + os.path.join(basedir, 'app/database.db')

config = {
    'development': DevConfig,

    'default': DevConfig
}